<div>
  <form class="form-horizontal" role="form"
        data-ng-search-form="">
    <input type="hidden" name="_csrf" value="{{csrf}}"/>
    <div class="onlinesrc-container">
      <div class="form-group">
        <div class="col-sm-10">
          <div class="input-group">
            <span class="input-group-addon"><i
              class="fa fa-search"/></span>
            <input class="form-control"
                   data-ng-change="triggerSearch()"
                   type="text"
                   data-ng-model="searchObj.params.any"
                   data-ng-model-options="modelOptions"
                   placeholder="{{'search' | translate}}" autofocus=""/>
          </div>
        </div>
      </div>
      <div data-gn-search-form-results
           data-gn-search-form-results-mode="simple"
           data-gn-search-form-results-selection-mode="local simple"
           data-search-results="searchResults"
           data-select-records="stateObj.selectRecords"
           data-pagination-info="paginationInfo">
      </div>

      <p class="alert alert-warning"
         data-ng-show="alertMsg">{{alertMsg}}</p>

      <h4 data-ng-show="mode == 'dataset' && layers.length > 0">
        <span data-translate="">chooseZeroOrMoreLayerFromService</span>
        <span>{{currentMdTitle}}</span>
      </h4>
      <h4 data-ng-show="mode == 'service' && layers.length > 0">
        <span data-translate="">chooseZeroOrMoreLayer</span>
        <span>{{currentMdTitle}}</span>
      </h4>
      <div data-gn-layers-grid
           data-gn-selection-mode="layerSelectionMode"
           data-layers="layers"
           data-selection="srcParams.selectedLayers">
      </div>

      <div>
        <label>
          <input type="checkbox"
                 data-ng-model="addOnlineSrcInDataset"/>
          <span data-translate="">addTheFollowingLinkInDataset</span>
        </label>
        <span>{{onlineSrcLink}}</span>
      </div>
    </div>
    <div class="">
      <button type="button" class="btn navbar-btn btn-success"
              data-gn-click-and-spin="linkTo(addOnlineSrcInDataset)"
              data-ng-class="{'disabled': (stateObj.selectRecords.length < 1)}">
        <i class="fa gn-icon-service"/>&nbsp;
        <span data-translate="" data-ng-show="mode == 'service'">linkToService</span>
        <span data-translate="" data-ng-hide="mode == 'service'">linkToDataset</span>
      </button>

      <div data-gn-need-help="user-guide/associating-resources/linking-dataset-or-service.html"
           class="pull-right"></div>
    </div>
  </form>
</div>
